<?php
	$id = Zend_Controller_Front::getInstance()->getRequest()->getParam('id');

	$form = $this->element;
?>
<link rel="stylesheet" media="screen" href="http://<?php echo Config::getInstance()->default->hostname; ?>/style/admin_product.css" />
<!--[if lte IE 7]><link href="/style/ie.css" rel="stylesheet" type="text/css"><![endif]-->
<form enctype="multipart/form-data" method="post" action="">
	<div>
	<?php
	/**
	 * Translate some form errrors.
	 *
	 * @param string $key
	 * @param string $error
	 * @return string
	*/
	function _translate($key, $error)
	{
		$_translated = array(
			'isEmpty' => 'Поле обязательно для заполнения',
		);

		if (isset($_translated[$key])) {
			return $_translated[$key];
		}
		return $error;
	}
	$errors = $form->getMessages();
	foreach ($errors as $key => $error) {
		if (is_array($error)) {
			unset($errors[$key]);
		}

		if (is_array($error)) {
			foreach ($error as $k => $v) {
				$label = $form->getElement($key)->getLabel();
				$v = _translate($k, $v);
				$errors[$key][$k] = "$label -- $v";
			}
		} else {
			$errors[$key] = _translate($key, $error);
		}
	}

	if ($errors) {
		echo "<ul class='errors'>";
		foreach ($errors as $error) {
			if (is_array($error)) {
				foreach ($error as $k => $v) {
					echo "<li>$v</li>";
				}
			} else {
				echo "<li>$error</li>";
			}
		}
		echo "</ul>";
	}
	?>


	<dd >
		<?php echo $form->getElement('key'); ?>
	</dd>
	<dd >
		<?php echo $form->getElement('name'); ?>
	</dd>
	<dd >
		<?php echo $form->getElement('size_discount'); ?>
	</dd>

	<br>
	<dd >
		<?php echo $form->getElement('attendant_ticket'); ?>
	</dd>
	<br>
	<dd >
		<?php echo $form->getElement('attendant_product'); ?>
	</dd>
	<br><br>
		
	<dd id="submit-element">
		<input type="submit" name="submit" id="submit" value="Сохранить">
	</dd>
	<br>
		<?php echo $form->getElement('crud_exit'); ?>
	<br>
</div>
</form>


